package com.majun.huaxishe.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 照片表
 * </p>
 *
 * @author 马骏
 * @since 2024-02-29
 */
@Data
@Builder
@TableName("photos")
@AllArgsConstructor
@NoArgsConstructor
public class Photos implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 照片名字
     */
    @TableField("name")
    private String name;

    /**
     * 照片路径
     */
    @TableField("url")
    private String url;

    /**
     * 照片权重
     */
    @TableField("weight")
    private String weight;

    /**
     * 所属相册id
     */
    @TableField("album_id")
    private Integer albumId;

    /**
     * 照片上传时间
     */
    @TableField("upload_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime uploadTime;
}
